using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.OleDb;
namespace prDe_Tai.TruyXuat
{
    class DemSoLuongPhanMem
    {
        LayDuLieu laydulieu = new LayDuLieu();
        public DataSet soluongphanmemtheochude(string chude, string loaiphanmem)
        {
            OleDbCommand com = new OleDbCommand();
            com.CommandType = CommandType.Text;
            com.CommandText = @"select count(sothutu) as soluong
                                            from DanhSachPhanMem
                                            where sothutu in( 
                                            SELECT  sothutu
                                            FROM DanhSachPhanMem
                                            where chude=@chude
                                            and loaiphanmem=@loaiphanmem)";
            com.Parameters.Add("@chude", OleDbType.BSTR).Value = chude;
            com.Parameters.Add("@loaiphanmem", OleDbType.BSTR).Value = loaiphanmem;
            DataSet ds = laydulieu.laydulieukhicothamso(com);
            return ds;
        }
        public DataSet soluongphanmemtrongchuongtrinh()
        {
            DataSet ds=laydulieu.laydulieukhikhongcothamso("select count(sothutu) as tongsoluong from DanhSachPhanMem");
            return ds;
        }
    }
}
